package com.diy.yuhaofilm.util

import com.diy.yuhaofilm.R
import com.diy.yuhaofilm.base.BaseFragment
import com.diy.yuhaofilm.ui.fragment.HomeFragment
import com.diy.yuhaofilm.ui.fragment.MvFragment
import com.diy.yuhaofilm.ui.fragment.VbangFragment
import com.diy.yuhaofilm.ui.fragment.YuedanFragment

/**
 *@Class: FragmentUtil
 *@Description:()
 *@Date: 2021/4/7  15:12
 *@Company:
 *@author: yuhao
 *@Version: v1.0
 */
class FragmentUtil private constructor(){     //私有化构造方法

    val homeFragment by lazy { HomeFragment() }
    val mvFragment by lazy { MvFragment() }
    val vbangFragment by lazy { VbangFragment() }
    val yuedanFragment by lazy { YuedanFragment() }

    companion object{
        val FragmentUtil by lazy { FragmentUtil() }
    }

   fun getFragment(tabId:Int): BaseFragment?{
       when(tabId){
           R.id.tab_home->return homeFragment
           R.id.tab_mv->return mvFragment
           R.id.tab_vbang->return vbangFragment
           R.id.tab_yuedan->return yuedanFragment

       }
       return null

    }


}